import com.hist.config.UserConfig;
import com.hist.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @auther Ren Gaoshuai
 * @date 2021-04-06 13:58
 *
 * 使用JavaConfig开发
 *
 **/
public class MyTest2 {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(UserConfig.class);
        User user = (User) context.getBean("getUser");
        System.out.println(user.name);
    }
}
